package net.oschina.app.testcases.favorites;

import android.test.ActivityInstrumentationTestCase2;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.hp.hpl.sparta.Text;
import com.robotium.solo.Solo;

import net.oschina.app.AppStart;
import net.oschina.app.BasicTestCase;

/**
 * Created by Aaron on 2017/5/26.
 */

public class AddToFavorite extends BasicTestCase {

    public void testName() throws Exception {
//        solo.clickOnView(solo.getView("net.oschina.app:id/nav_item_me"));
//        solo.clickOnView(solo.getView("net.oschina.app:id/iv_portrait"));
//        EditText nameET = (EditText) solo.getView("net.oschina.app:id/et_username");
//        EditText pwdET = (EditText) solo.getView("net.oschina.app:id/et_password");
//        solo.clearEditText(nameET);
//        solo.enterText(nameET,"735723619@qq.com");
//        solo.clearEditText(pwdET);
//        solo.enterText(pwdET,"12345678");
//        Button loginBtn = (Button)solo.getView("net.oschina.app:id/btn_login");
//        solo.clickOnView(loginBtn);
//        solo.clickOnView(solo.getView("net.oschina.app:id/nav_item_news"));
//        solo.sleep(3000);
//        TextView firstNewsItem = (TextView)solo.getView("net.oschina.app:id/tv_title",1);
//        String expectedNewsTitle = firstNewsItem.getText().toString();
//        solo.clickOnView(firstNewsItem);
//        View favoriteIcon = solo.getView("net.oschina.app:id/iv_fav");
//        solo.waitForView(favoriteIcon,1,5000);
//        solo.clickOnView(favoriteIcon);
//        solo.sleep(2000);
//        solo.goBack();
//        solo.clickOnView(solo.getView("net.oschina.app:id/nav_item_me"));
//        solo.clickOnView(solo.getView("net.oschina.app:id/ly_favorite"));
//        TextView title = (TextView) solo.getView("net.oschina.app:id/tv_favorite_title",0);
//        String actualNewsTitle = title.getText().toString();
//        assertTrue(expectedNewsTitle.contains(actualNewsTitle));
    }


}
